<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMemberAddressesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member_addresses', function (Blueprint $table) {
            $table->id();
            $table->integer('member_id')->default(0)->comment('会员ID');
            $table->string('consignee', 100)->nullable()->comment('联系人');
            $table->string('mobile', 20)->nullable()->comment('联系电话');
            $table->integer('country')->default('100000')->comment('国家');
            $table->integer('province')->nullable()->comment('省');
            $table->integer('city')->nullable()->comment('市');
            $table->integer('district')->nullable()->comment('区');
            $table->string('address', 255)->nullable()->comment('详细地址');
            $table->unsignedTinyInteger('default')->default(0)->comment("默认:0、不默认 1、默认");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member_addresses');
    }
}
